{load header}
<!--/H-->
    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
                        <!-- nav -->
            

 	<div class="main-title">
        <h2>用户列表</h2>
    </div>           
	
	<div class="cf">
		<div style="float: left;">
                    <input type="hidden" id="plat_en" value="{$plat_en}">
                    <input type="file" id="upload_xls_cover_id" title="导入excel表"/>
                    <script type="text/javascript" src="{eval echo base_url()}static/uploadify/jquery.uploadify.min.js"></script>
                </div>
                <i class="import-status-tip" style="line-height: 31px;margin-left: 8px;font-style: normal;color: #f39a00;">&nbsp;</i>
		
                
		<!-- 高级搜索 -->
		<div class="search-form fr cf">
		<div class="sleft">
				<div class="drop-down">
					<span id="sch-sort-txt" class="sort-txt" data="{if $icon_type}{$icon_type}{else}1{/if}">{if $icon}{$icon}{else}手机号{/if}</span>
					<i class="arrow arrow-down"></i>
					<ul id="sub-sch-menu" class="nav-list hidden">
                                            <li><a href="javascript:;" value="1">手机号</a></li>
                                            <li><a href="javascript:;" value="2">邮箱</a></li>
					</ul>
				</div>
				<input type="text" name="q" class="search-input" value="{$keyword}" placeholder="请输入关键词">
				<a class="sch-btn" href="javascript:;" id="search" url=""><i class="btn-search"></i></a>
			</div>
			<div class="btn-group-click adv-sch-pannel fl">
				
            </div>
		</div>
	</div>
	<div class="data-table table-striped">
		<table>
			<thead>
				<tr>
                                    <th>ID</th>
                                    <th>手机号</th>
                                    <th>邮箱</th>
                                    <th>真实姓名</th>
                                    <th>身份证</th>
                                    <th>是否注册</th>
				</tr>
			</thead>
			<tbody>
				<!--{loop $list $val}-->
				<tr>
                                    <td>{$val['user_id']}</td>
                                    <td>{$val['mobile']}</td>
                                    <td>{$val['email']}</td>
                                    <td>{$val['true_name']}</td>
                                    <td>{$val['ID_card']}</td>
                                    {if $val['is_reg']}
                                    <td style="color:red;">已注册</td>
                                    {else}
                                    <td>未注册</td>
                                    {/if}
				</tr>
				<!--{/loop}-->
			</tbody>
		</table>
		<!-- 分页 -->
	    <div class="page">
	        <div>
			{$showpage}
			<span class="rows">共 {$Total} 条记录</span>
			</div>
		</div>
	</div>
<link href="{eval echo base_url()}static/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="{eval echo base_url()}static/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="{eval echo base_url()}static/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="{eval echo base_url()}static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>	
<script type="text/javascript">
$(function(){
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
		var status = $("#sch-sort-txt").attr("data");
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
		if(status != ''){
			query += '&st=' + status ;
        }
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

	/* 状态搜索子菜单 */
	$(".search-form").find(".drop-down").hover(function(){
		$("#sub-sch-menu").removeClass("hidden");
	},function(){
		$("#sub-sch-menu").addClass("hidden");
	});
	$("#sub-sch-menu li").find("a").each(function(){
		$(this).click(function(){
			var text = $(this).text();
			$("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
			$("#sub-sch-menu").addClass("hidden");
		})
	});
    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });
})

</script>
<script type="text/javascript">
                    var obj_tip = $('.import-status-tip');
                    //上传文件
                    /* 初始化上传插件 */
                    $("#upload_xls_cover_id").uploadify({
                            "height"          : 33,
                            "swf"             : "{eval echo base_url()}static/uploadify/uploadify.swf",
                            "fileObjName"     : "excel",
                            "buttonText"      : "导入excel数据表",
                            "uploader"        : "{eval echo site_url('file/uploadxls')}",
                            "width"           : 120,
                            'removeTimeout'	  : 1,
                            'fileTypeExts'	  : '*.xls;',
                            "onUploadSuccess" : upload_seccess_callback,
                            'onFallback' : function() {
                                    alert('未检测到兼容版本的Flash.');
                            }
                    });
                    function upload_seccess_callback(file, data1){
                        var response = $.parseJSON(data1);
                        if(response.status == 1){
                            var FILE_URL = response.url;
                            var _Name_en = $('#plat_en').val();
                            obj_tip.html("正在导入数据...");
                            $.ajax({
                                url:"{eval echo site_url('members/import_users_line')}",
                                async: true,
                                dataType:"json",
                                type:"post",
                                data: {file_url:FILE_URL,name_en:_Name_en},
                                success:function(res){
                                    if(res.status == 1){
                                        obj_tip.html("导入失败");
                                        alert(res.error);
                                    }else{
                                        obj_tip.html(res.info);
                                    }
                                }
                            });
                        }else{
                            alert(response.info);
                        }
                    }
                </script>	
	
			</div>
	</div>
<!--F-->{load footer}